#include<stdio.h>
#include<string.h>
int main()
{
	char word1[20], word2[20];
	int i,j,flag=0;
	int len1, len2;

	printf("Enter first word:");
	scanf("%s", word1);
	
	printf("Enter the second word :");
	scanf("%s", word2);
	

	len1=strlen(word1);
	len2 = strlen(word2);
	if (len1 == len2) {
		for (j = 0; j < len2; j++) {
			for (i = 0; i < len1; i++) {
				if (word2[j] != word1[i])
					flag = 0;
				else {
					flag = 1;
					break;
				}
            }
		}
		if (flag == 1)
			printf("The words are anagrams.");
	}
	else
		printf("The words are not anagrams.");
}